<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../application/vue.js"></script>
</head>
<body>
    <div id="app">
        <p v-bind:id="id">绑定id属性</p>
        <input type="button" value="切换id属性值" @click="id='新值'">
        <p v-bind:class="'haha'">绑定类属性</p>
        <p v-bind:name="'xixi'">绑定name属性</p>
        <p v-bind:data-item="'heihei'">绑定data-item属性</p>
        <hr>
        <div :innerHTML="str"></div>
        <div :inner-html="str"></div>
        <div :inner-html.prop="str"></div>
        <div :hidden.prop="false">哈哈哈</div>
        <div :clientHeight.prop="40">嘻嘻</div>
        <hr>
        <div id="itany" :itany="id" @click="printAttr($event.target)">绑定itany属性</div>
        <div :user-name.camel="id">绑定itany属性</div>
        <hr>
        <div :itany.prop="id" @click="printName($event.target)">绑定DOM属性</div>
        <div :user-name.prop="id" @click="printName1($event.target)">绑定DOM属性</div>
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                id:"绑定id属性",
                str:"<p>哈哈哈哈哈</p>"
            },
            methods:{
                printAttr(e){
                    console.log(e.getAttribute("itany"));                  
                },
                printName(e){
                    console.log(e.itany);
                },
                printName1(e){
                    console.log(e.userName);
                }
            }
        })
    </script>
</body>
</html>